//
//  GDHChatKeyBoardHeader.h
//  GDHChatKeyBoard
//
//  Created by 高得华 on 2017/10/11.
//  Copyright © 2017年 高得华. All rights reserved.
//

#ifndef GDHChatKeyBoardHeader_h
#define GDHChatKeyBoardHeader_h
#if __has_include(<Masonry/Masonry.h>)
#import <Masonry/Masonry.h>
#else
#import "Masonry.h"
#endif
#import "NSString+Emoji.h"
#import "GDHFaceSourceManager.h"

#pragma mark - ----- GDHChatKeyBoard -----
static NSString * const emoji          = @"GDHChatKeyBoardResources.bundle/emoji";
static NSString * const keyboard       = @"GDHChatKeyBoardResources.bundle/keyboard";
static NSString * const camera         = @"GDHChatKeyBoardResources.bundle/camera";
static NSString * const photo          = @"GDHChatKeyBoardResources.bundle/photo";
static NSString * const video          = @"GDHChatKeyBoardResources.bundle/video";
static NSString * const voice          = @"GDHChatKeyBoardResources.bundle/voice";
static NSString * const voiceVideo     = @"GDHChatKeyBoardResources.bundle/voiceVideo";

static NSString * const selectedEmoji       = @"GDHChatKeyBoardResources.bundle/emojiHighlighted";
static NSString * const selectedVoice       = @"GDHChatKeyBoardResources.bundle/voiceHighlighted";
static NSString * const selectedVideo       = @"GDHChatKeyBoardResources.bundle/videoHighlighted";
static NSString * const selectedPhoto       = @"GDHChatKeyBoardResources.bundle/photoHighlighted";
static NSString * const selectedCamera      = @"GDHChatKeyBoardResources.bundle/cameraHighlighted";
static NSString * const selectedVoiceVideo  = @"GDHChatKeyBoardResources.bundle/voiceVideoHighlighted";

/**礼物按钮图片*/
static NSString * const buttongift = @"GDHChatKeyBoardResources.bundle/giftbutton";
//表情视图中删除按钮
static NSString * const buttonDelete_ios7 = @"GDHChatKeyBoardResources.bundle/delete_ios7";


/**  判断文字中是否包含表情 */
static inline BOOL IsTextContainFace(NSString * text) {
    return [text containsString:@"["] && [text containsString:@"]"] && [[text substringFromIndex:text.length - 1] isEqualToString:@"]"];
}
//#define IsTextContainFace(text) [text containsString:@"["] && [text containsString:@"]"] && [[text substringFromIndex:text.length - 1] isEqualToString:@"]"]

/** 判断emoji下标 */
static inline NSString * emojiText(NSString * text) {
    return (text.length >= 2) ? [text substringFromIndex:text.length - 2] : [text substringFromIndex:0];
}
//#define emojiText(text)  (text.length >= 2) ? [text substringFromIndex:text.length - 2] : [text substringFromIndex:0]

//ChatKeyBoard背景颜色
static inline UIColor * kChatKeyBoardColor() {
    return [UIColor colorWithRed:245/255.f green:245/255.f blue:245/255.f alpha:1.0f];
}
//#define kChatKeyBoardColor              [UIColor colorWithRed:245/255.f green:245/255.f blue:245/255.f alpha:1.0f]
static inline UIImage * ImgName(NSString * str) {
    return (str == nil || str.length == 0) ? nil : [UIImage imageNamed:str];
}
//#define ImgName(str)              (str == nil || str.length == 0) ? nil : [UIImage imageNamed:str]

///键盘上面的工具条
static CGFloat const kExpandingHeight = 50;
//#define kExpandingHeight    50
static CGFloat const kGDHChatToolBarHeight = kExpandingHeight*2;
//#define kGDHChatToolBarHeight  kExpandingHeight*2
static CGFloat const kTopSpace = 9;
//#define kTopSpace           9
static CGFloat const kItemSize = (kExpandingHeight-kTopSpace-kTopSpace);
//#define kItemSize           (kExpandingHeight-kTopSpace-kTopSpace)

//语音面板的高度
static CGFloat const kVoicePanelHeight = 216;

//整个聊天工具的高度
static CGFloat const kGDHChatKeyBoardHeight = kGDHChatToolBarHeight + kVoicePanelHeight;


//MARK: - ==== 类似微信的 键盘
///键盘上面的工具条
static CGFloat const kChatToolBarHeight = 49;
//#define kChatToolBarHeight              49

///表情模块高度
static inline CGFloat kFacePanelHeight() {
    /*CGFloat h = 216;
    if (@available(iOS 11.0, *)) {
        h += [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
    }
    return h;*/
    return 216;
}
//static CGFloat const kFacePanelHeight = 216;
//#define kFacePanelHeight                216
static CGFloat const kFacePanelBottomToolBarHeight = 40;
//#define kFacePanelBottomToolBarHeight   40
static CGFloat const kUIPageControllerHeight = 25;
//#define kUIPageControllerHeight         25

//拍照、发视频等更多功能模块的面板的高度
static CGFloat const kMorePanelHeight = 216;
//#define kMorePanelHeight                216
static CGFloat const kMoreItemH = 80;
//#define kMoreItemH                      80
static CGFloat const kMoreItemIconSize = 60;
//#define kMoreItemIconSize               60


//整个聊天工具的高度
static CGFloat const kChatKeyBoardHeight = kChatToolBarHeight + kMorePanelHeight;//kFacePanelHeight();
//#define kChatKeyBoardHeight     kChatToolBarHeight + kFacePanelHeight


///键盘
#import "ChatKeyBoard.h"
#import "GDHFacePanel.h"


#endif /* GDHChatKeyBoardHeader_h */
